﻿<UserControl x:Class="Chapters.Chapter10.ResourceKeyTester"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Chapter10="clr-namespace:FSharp.Chapter10;assembly=FSharpLibrary">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Brushes.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="{x:Type TextBlock}"
                   TargetType="TextBlock">
                <Setter Property="VerticalAlignment"
                        Value="Center" />
                <Setter Property="TextWrapping"
                        Value="Wrap" />
                <Setter Property="FontSize"
                        Value="18" />
            </Style>

        </ResourceDictionary>
    </UserControl.Resources>
    <UniformGrid Rows="1"
                 Height="300"
                 Margin="20">

        <Chapter10:SkinThemeControl Margin="0,0,20,0">
            <TextBlock Foreground="LightGray">Using ComponentResourceKey: the Background property resolves to the resource in Generic.xaml</TextBlock>
        </Chapter10:SkinThemeControl>

        <Chapter10:SkinThemeControl Background="{DynamicResource RegularBrush}">
            <TextBlock>Using a string-key resource: The RegularBrush resource in Generic.xaml gets overridden by a local resource</TextBlock>
        </Chapter10:SkinThemeControl>

    </UniformGrid>
</UserControl>
